package com.zzyl.task;

import com.zzyl.mapper.ReservationMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class MyTask {
    @Autowired
    private ReservationMapper reservationMapper;

    @Scheduled(cron = "0 16,46 * * * ?")
    public void updateReservation() {
        log.info("{}", LocalDateTime.now());
        reservationMapper.updateReservation();
    }
}
